<%@ Import Namespace="System.Diagnostics" %>
<%@ Import Namespace="System.Text" %>

<script language="VB" runat=server>

   Sub Page_Load(Sender as Object, E as EventArgs) 

      if (Application("MemLeak") = Nothing) Then
        Application("MemLeak") = New StringBuilder
      End If

      Dim i as Integer
      Dim buffer as StringBuilder = Application("MemLeak")

      For i=1 to 100000
         buffer.Append("Adding more and more and more...")
      Next i

      Dim ProcessInfo as Process = Process.GetCurrentProcess()
      
      ProcessId.Text = ProcessInfo.Id.ToString()
      VirtualMemSize.Text = ProcessInfo.VirtualMemorySize.ToString()
   
   End Sub

</script>

<html>
   <body>

      <h1> Memory Leak Example.... </h1>

      <hr>

      <h2>Process ID of ASP+: <asp:label id="ProcessId" forecolor=red runat=server/> </h2>
      <h2>Virtual Memory Size of ASP+: <asp:label id="VirtualMemSize" forecolor=red runat=server/> </h2>

   </body>
</html>